<?php

/**
 * Performances filter form base class.
 *
 * @package    gamerstats
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasePerformancesFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'user'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Users'), 'add_empty' => true)),
      'round'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Rounds'), 'add_empty' => true)),
      'stat1'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'stat2'          => new sfWidgetFormFilterInput(),
      'stat3'          => new sfWidgetFormFilterInput(),
      'stat4'          => new sfWidgetFormFilterInput(),
      'stat5'          => new sfWidgetFormFilterInput(),
      'stat6'          => new sfWidgetFormFilterInput(),
      'stat7'          => new sfWidgetFormFilterInput(),
      'stat8'          => new sfWidgetFormFilterInput(),
      'stat9'          => new sfWidgetFormFilterInput(),
      'stat10'         => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'user'           => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Users'), 'column' => 'idusers')),
      'round'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Rounds'), 'column' => 'idrounds')),
      'stat1'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat2'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat3'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat4'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat5'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat6'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat7'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat8'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat9'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat10'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('performances_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Performances';
  }

  public function getFields()
  {
    return array(
      'idperformances' => 'Number',
      'user'           => 'ForeignKey',
      'round'          => 'ForeignKey',
      'stat1'          => 'Number',
      'stat2'          => 'Number',
      'stat3'          => 'Number',
      'stat4'          => 'Number',
      'stat5'          => 'Number',
      'stat6'          => 'Number',
      'stat7'          => 'Number',
      'stat8'          => 'Number',
      'stat9'          => 'Number',
      'stat10'         => 'Number',
    );
  }
}
